#include "mxsetup.h"

#ifdef USE_KPROCESS
#include "compiler.h"

/* the link script for gcc */
#ifdef MX_COMPILER_TYPE_GCC
ENTRY(main)
SECTIONS
{
    . = MXSETUP_KAPP_BASEADDR;
    .text :
    {
        *(.text*)
        *(.rodata*)
    }
    .kapp.label : { *(.kapp.label) }    // the lable of kernel app
    .plt : { *(.plt) }                  // for elf type: DYN
    .got : { *(.got) }                  // for elf type: for DYN or EXEC
    .got.plt : { *(.got.plt) }          // for elf type: for DYN
    .data :
    {
        . = ALIGN(8);                   // ISSUE: it's hard to get the ARCH's information, here is better to write `MX_CPU_BITWIDE / 8`
        __kdata_start = .;
        *(.data*)
        __kdata_end = .;
    }
    .bss :
    {
        . = ALIGN(8);
        __kbss_start = .;
        *(.bss*)
        . = ALIGN(8);                   // to avoid overlap other section when do bss cleaning
        __kbss_end = .;
    }
    /* generated by ld */
    .dynamic : { *(.dynamic) }
    .dynsym : { *(.dynsym) }
    .rela.dyn : { *(.rela.dyn) }
    .hash : { *(.hash) }
    .gnu.hash : { *(.gnu.hash) }
    /* delete unimportant sections who generated by ld */
    /DISCARD/ :
    {
        *(.comment)
        *(.eh_frame)
        *(.debug*)
    }
}
#endif /* MX_COMPILER_TYPE_GCC */

#endif /* USE_KPROCESS */
